<template>
  <div class="achievement">
    <tab-component title="人员业绩" tabPosition="right">
      <tab-panel-component label="系统记录业绩(10)" name="record">
        <el-table :data="tableSta.list" style="width: 100%" class="detail-table tableSta">
          <el-table-column type="index" label="序号" width="80"></el-table-column>
          <el-table-column prop="projectName" label="工程名称" width="420"></el-table-column>
          <el-table-column prop="" label="进出场时间" width="250">
            <template slot-scope="scope">
              <div>{{scope.row.proStartTime}}~{{scope.row.proEndTime}}</div>
            </template>
          </el-table-column>
          <el-table-column prop="proRole" label="项目角色" width="180"></el-table-column>
          <el-table-column prop="proMajorName" label="专业名称" width="160"></el-table-column>
          <el-table-column align="right" prop="proPerScore" label="业绩指数">
            <template slot-scope="scope">
              <div class="orange text-right">{{scope.row.proPerScore}}</div>
            </template>
          </el-table-column>
        </el-table>
        <div class="padding-top-20">
          <el-pagination
            background
            @size-change="getTableSta"
            @current-change="getTableSta"
            :current-page.sync="query.pg"
            :page-sizes="[5, 10, 15, 20]"
            :page-size.sync="query.pgsz"
            layout="total, sizes, prev, pager, next, jumper"
            :total="tableSta.total">
          </el-pagination>
        </div>
      </tab-panel-component>
      <tab-panel-component label="补录业绩(8)" name="supplement">
        <el-table :data="tableSta.list" style="width: 100%" class="detail-table tableSta">
          <el-table-column type="index" label="序号" width="80"></el-table-column>
          <el-table-column prop="projectName" label="工程名称" width="420"></el-table-column>
          <el-table-column prop="" label="进出场时间" width="250">
            <template slot-scope="scope">
              <div>{{scope.row.proStartTime}}~{{scope.row.proEndTime}}</div>
            </template>
          </el-table-column>
          <el-table-column prop="proRole" label="项目角色" width="180"></el-table-column>
          <el-table-column prop="proMajorName" label="专业名称" width="160"></el-table-column>
          <el-table-column align="right" prop="proPerScore" label="业绩指数">
            <template slot-scope="scope">
              <div class="orange text-right">{{scope.row.proPerScore}}</div>
            </template>
          </el-table-column>
        </el-table>
        <div class="padding-top-20">
          <el-pagination
            background
            @size-change="getTableSta"
            @current-change="getTableSta"
            :current-page.sync="query.pg"
            :page-sizes="[5, 10, 15, 20]"
            :page-size.sync="query.pgsz"
            layout="total, sizes, prev, pager, next, jumper"
            :total="tableSta.total">
          </el-pagination>
        </div>
      </tab-panel-component>
    </tab-component>
  </div>
</template>

<script>
  import {getTableSta} from '@/api/dataService/index';

  export default {
    name: "achievement",
    data() {
      return {
        query: {
          pg: 1,
          pgsz: 5
        },
        tableSta: {//人员业绩
          fun: 'getTableSta',
          list: [],
          total: 0,
          query: {
            pg: 1,
            pgsz: 5,
            value: '330100'
          }
        }
      }
    },
    mounted() {
      this.getTableSta();
    },
    methods: {
      //获取人员业绩
      getTableSta(data) {
        let {pg, pgsz, value} = this.tableSta.query;
        data = {pg, pgsz, value};
        getTableSta(data).then(res => {
          this.tableSta.list = res.rows;
          this.tableSta.total = res.total;
        })
      }
    }
  }
</script>

<style scoped>

</style>
